.class public Les/bu;
.super Ljava/util/Observable;
.source "ScanAllHosts.java"

# interfaces
.implements Ljava/util/Observer;
.implements Ljava/lang/Runnable;


# static fields
.field private static final g:Ljava/lang/String;

.field protected static h:I


# instance fields
.field private a:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList<",
            "Les/au;",
            ">;"
        }
    .end annotation
.end field

.field private b:Ljava/util/concurrent/atomic/AtomicInteger;

.field private c:Z

.field private d:Les/zt;

.field private e:Z

.field private f:Z


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 1
    const-class v0, Les/bu;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Les/bu;->g:Ljava/lang/String;

    const/16 v0, 0x1e

    .line 2
    sput v0, Les/bu;->h:I

    return-void
.end method

.method public constructor <init>(Les/zt;)V
    .locals 2

    .line 1
    invoke-direct {p0}, Ljava/util/Observable;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-object v0, p0, Les/bu;->a:Ljava/util/ArrayList;

    .line 3
    new-instance v0, Ljava/util/concurrent/atomic/AtomicInteger;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>(I)V

    iput-object v0, p0, Les/bu;->b:Ljava/util/concurrent/atomic/AtomicInteger;

    .line 4
    iput-boolean v1, p0, Les/bu;->c:Z

    .line 5
    iput-boolean v1, p0, Les/bu;->e:Z

    const/4 v0, 0x1

    .line 6
    iput-boolean v0, p0, Les/bu;->f:Z

    .line 7
    iput-object p1, p0, Les/bu;->d:Les/zt;

    return-void
.end method

.method static synthetic a(Les/bu;)Ljava/util/concurrent/atomic/AtomicInteger;
    .locals 0

    .line 1
    iget-object p0, p0, Les/bu;->b:Ljava/util/concurrent/atomic/AtomicInteger;

    return-object p0
.end method

.method private b(Ljava/util/ArrayList;)V
    .locals 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/ArrayList<",
            "Les/au;",
            ">;)V"
        }
    .end annotation

    if-eqz p1, :cond_6

    .line 1
    invoke-virtual {p1}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-eqz v0, :cond_6

    iget-boolean v0, p0, Les/bu;->c:Z

    if-eqz v0, :cond_0

    goto/16 :goto_3

    .line 2
    :cond_0
    iget-object v0, p0, Les/bu;->d:Les/zt;

    invoke-virtual {v0}, Les/zt;->c()Ljava/util/ArrayList;

    move-result-object v0

    const/4 v1, 0x0

    const/4 v2, 0x0

    .line 3
    :goto_0
    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v3

    if-ge v2, v3, :cond_4

    .line 4
    invoke-static {}, Les/s80;->A()Les/s80;

    move-result-object v3

    .line 5
    iget-boolean v4, p0, Les/bu;->c:Z

    if-eqz v4, :cond_1

    goto :goto_2

    :cond_1
    if-eqz v3, :cond_2

    .line 6
    invoke-virtual {v3}, Les/s80;->z()Z

    move-result v3

    if-eqz v3, :cond_2

    .line 7
    invoke-static {}, Les/zt;->g()Les/zt;

    move-result-object v3

    invoke-virtual {v3}, Les/zt;->b()V

    .line 8
    :cond_2
    invoke-virtual {v0, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/net/InetAddress;

    .line 9
    :goto_1
    iget-object v4, p0, Les/bu;->b:Ljava/util/concurrent/atomic/AtomicInteger;

    invoke-virtual {v4}, Ljava/util/concurrent/atomic/AtomicInteger;->get()I

    move-result v4

    sget v5, Les/bu;->h:I

    if-le v4, v5, :cond_3

    const-wide/16 v4, 0x46

    .line 10
    :try_start_0
    invoke-static {v4, v5}, Ljava/lang/Thread;->sleep(J)V
    :try_end_0
    .catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_1

    :catch_0
    nop

    goto :goto_1

    .line 11
    :cond_3
    new-instance v4, Les/du;

    invoke-direct {v4, v3, p1}, Les/du;-><init>(Ljava/net/InetAddress;Ljava/util/ArrayList;)V

    .line 12
    invoke-virtual {v4, p0}, Ljava/util/Observable;->addObserver(Ljava/util/Observer;)V

    .line 13
    iget-object v3, p0, Les/bu;->b:Ljava/util/concurrent/atomic/AtomicInteger;

    invoke-virtual {v3}, Ljava/util/concurrent/atomic/AtomicInteger;->incrementAndGet()I

    .line 14
    new-instance v3, Les/bu$a;

    invoke-direct {v3, p0, v4}, Les/bu$a;-><init>(Les/bu;Les/du;)V

    invoke-static {v3}, Lcom/estrongs/android/util/o;->a(Ljava/lang/Runnable;)V

    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    .line 15
    :cond_4
    :goto_2
    iget-boolean p1, p0, Les/bu;->c:Z

    if-nez p1, :cond_5

    iget-object p1, p0, Les/bu;->b:Ljava/util/concurrent/atomic/AtomicInteger;

    invoke-virtual {p1}, Ljava/util/concurrent/atomic/AtomicInteger;->get()I

    move-result p1

    if-eqz p1, :cond_5

    const-wide/16 v2, 0x258

    .line 16
    :try_start_1
    invoke-static {v2, v3}, Ljava/lang/Thread;->sleep(J)V
    :try_end_1
    .catch Ljava/lang/InterruptedException; {:try_start_1 .. :try_end_1} :catch_1

    goto :goto_2

    :catch_1
    nop

    goto :goto_2

    .line 17
    :cond_5
    iget-object p1, p0, Les/bu;->b:Ljava/util/concurrent/atomic/AtomicInteger;

    invoke-virtual {p1, v1}, Ljava/util/concurrent/atomic/AtomicInteger;->set(I)V

    :cond_6
    :goto_3
    return-void
.end method


# virtual methods
.method public a(Ljava/util/ArrayList;)V
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/ArrayList<",
            "Les/au;",
            ">;)V"
        }
    .end annotation

    if-eqz p1, :cond_0

    .line 2
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0, p1}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V

    iput-object v0, p0, Les/bu;->a:Ljava/util/ArrayList;

    :cond_0
    return-void
.end method

.method public a()Z
    .locals 1

    .line 3
    iget-boolean v0, p0, Les/bu;->e:Z

    return v0
.end method

.method public run()V
    .locals 5

    .line 1
    iget-object v0, p0, Les/bu;->a:Ljava/util/ArrayList;

    if-nez v0, :cond_0

    .line 2
    sget-object v0, Les/bu;->g:Ljava/lang/String;

    const-string v1, "ScanAllHosts run error, scan type is null"

    invoke-static {v0, v1}, Lcom/estrongs/android/util/n;->b(Ljava/lang/String;Ljava/lang/String;)V

    return-void

    :cond_0
    const/4 v1, 0x1

    .line 3
    iput-boolean v1, p0, Les/bu;->e:Z

    .line 4
    iget-boolean v1, p0, Les/bu;->f:Z

    if-eqz v1, :cond_3

    .line 5
    new-instance v0, Ljava/util/ArrayList;

    iget-object v1, p0, Les/bu;->a:Ljava/util/ArrayList;

    invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V

    .line 6
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    .line 7
    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_1
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_2

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Les/au;

    .line 8
    iget v4, v3, Les/au;->a:I

    if-nez v4, :cond_1

    .line 9
    invoke-virtual {v1, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 10
    invoke-virtual {v0, v3}, Ljava/util/ArrayList;->remove(Ljava/lang/Object;)Z

    .line 11
    :cond_2
    invoke-direct {p0, v1}, Les/bu;->b(Ljava/util/ArrayList;)V

    .line 12
    invoke-direct {p0, v0}, Les/bu;->b(Ljava/util/ArrayList;)V

    goto :goto_0

    .line 13
    :cond_3
    invoke-direct {p0, v0}, Les/bu;->b(Ljava/util/ArrayList;)V

    .line 14
    :goto_0
    invoke-virtual {p0}, Ljava/util/Observable;->setChanged()V

    .line 15
    invoke-virtual {p0}, Ljava/util/Observable;->notifyObservers()V

    .line 16
    iget-object v0, p0, Les/bu;->b:Ljava/util/concurrent/atomic/AtomicInteger;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Ljava/util/concurrent/atomic/AtomicInteger;->set(I)V

    .line 17
    iput-boolean v1, p0, Les/bu;->c:Z

    .line 18
    iput-boolean v1, p0, Les/bu;->e:Z

    return-void
.end method

.method public stop()V
    .locals 1

    const/4 v0, 0x1

    .line 1
    iput-boolean v0, p0, Les/bu;->c:Z

    return-void
.end method

.method public update(Ljava/util/Observable;Ljava/lang/Object;)V
    .locals 0

    .line 1
    instance-of p1, p1, Les/du;

    if-eqz p1, :cond_1

    .line 2
    instance-of p1, p2, Les/cu;

    if-nez p1, :cond_0

    return-void

    .line 3
    :cond_0
    move-object p1, p2

    check-cast p1, Les/cu;

    iget p1, p1, Les/cu;->d:I

    if-nez p1, :cond_1

    .line 4
    invoke-virtual {p0}, Ljava/util/Observable;->setChanged()V

    .line 5
    invoke-virtual {p0, p2}, Ljava/util/Observable;->notifyObservers(Ljava/lang/Object;)V

    :cond_1
    return-void
.end method
